package com.schoolvisitors.dto;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;

@Data
public class UpdateUserDtoByManage {

    @NotNull
    private Long id;

    @NotBlank(message = "昵称不能为空")
    @Size(min = 2, max = 16, message = "昵称长度必须在2到16个字符之间")
    @Pattern(regexp = "^[\\u4e00-\\u9fa5a-zA-Z0-9_]+$", message = "昵称只能包含中文、字母、数字、下划线，不能有空格或特殊字符")
    private String nickname;

    @NotBlank(message = "真实姓名不能为空")
    @Size(min = 2, message = "真实姓名长度不能小于2个字符")
    @Size(max = 5, message = "真实姓名长度不能超过5个字符")
    private String realName;

    @NotBlank(message = "职位不能为空")
    private String position;

    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String phone;

    @NotBlank(message = "身份证号不能为空")
    @Pattern(regexp = "^[1-9]\\d{5}(18|19|20)\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\\d|3[01])\\d{3}[0-9Xx]$", message = "身份证号格式不正确")
    private String idNumber;

    @NotNull(message = "性别不能为空")
    private String gender;

    @NotNull
    private Boolean reservationPermission;

}